package android.gpsmessenger;

public class Trip 
{
	private String _name;
	private LocationList _locations;
	private ContactList _contacts;
	
	// constructors
	Trip(String name, LocationList locations, ContactList contacts)
	{
		_name = name;
		_locations = locations;
		_contacts = contacts;
	}
	
	Trip(String name )
	{
		this(name, new LocationList(), new ContactList());
	}
	
	Trip()
	{
		this("new trip", new LocationList(), new ContactList());
	}

	Trip(Trip trip)
	{
		this(trip.getName(), trip.getLocations(), trip.getContacts());
	}
	
	// getters
	public String getName()
	{
		return _name;
	}
	
	public LocationList getLocations()
	{
		return _locations;
	}
	
	public ContactList getContacts()
	{
		return _contacts;
	}
	
	// setters
	public void setName(String name)
	{
		_name = name;
	}
	
	public void setLocations(LocationList locations)
	{
		_locations = locations;
	}
	
	public void setContactList(ContactList contacts)
	{
		_contacts = contacts;
	}
	
	// other methods
	public String toString()
	{
		return ("Trip: " + _name + "\n" +
				"Location List: " + _locations + "\n" +
				"Contact List: " + _contacts + "\n");
	}
	
	public void addLocation(Location location)
	{
		_locations.add(location);
	}
	
	public void removeLocation(Location location)
	{
		_locations.remove(location);
	}
	
	public void addContact(Contact contact)
	{
		_contacts.add(contact);
	}
		
	public void removeContact(Contact contact)
	{
		_contacts.remove(contact);
	}
}
